using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using WoogiWorld.Event;

public class UI2 : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        EventDispatcher.Instance.AddEventListener(123, this, OnCall);
    }

    private void OnCall(EventMessage info)
    {
        UnityEngine.Profiling.Profiler.BeginSample("OnCall");
        if (info.CheckNewData())
        {
            info.ReadNewData<TestData>();
        }

        UnityEngine.Profiling.Profiler.EndSample();
        UnityEngine.Profiling.Profiler.BeginSample("OnCall_1");
        info.ReadNewData<TestData>(0);

        UnityEngine.Profiling.Profiler.EndSample();
    }
}